package com.boil.qz.safekavass.weixin.model.reply;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by ChenYong on 2017-04-28.
 * <br>
 * 图文消息。
 */
public class NewsMsg extends BaseMsg {
    /**
     * 图文消息个数，限制为10条以内
     */
    private int ArticleCount;
    /**
     * 多条图文消息信息，默认第一个 item 为大图。注意：如果图文数超过10，则将会无响应
     */
    private List<Article> Articles = new ArrayList<Article>();

    public NewsMsg() {
        super();

        ArticleCount = Articles.size();
    }

    public int getArticleCount() {
        return ArticleCount;
    }

    public List<Article> getArticles() {
        return Articles;
    }

    public void setArticles(List<Article> articles) {
        if (articles != null) {
            this.Articles = articles;
            this.ArticleCount = this.Articles.size();
        }
    }

    @Override
    public String toString() {
        final StringBuffer sb = new StringBuffer("NewsMsg{");
        sb.append("ToUserName='").append(ToUserName).append('\'');
        sb.append(", ArticleCount=").append(ArticleCount);
        sb.append(", FromUserName='").append(FromUserName).append('\'');
        sb.append(", CreateTime=").append(CreateTime);
        sb.append(", Articles=").append(Articles);
        sb.append(", MsgType='").append(MsgType).append('\'');
        sb.append('}');
        return sb.toString();
    }
}